package com.freshmarket.freshmarket.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private boolean success;
    private int code;
    private String message;
    private Object data;

    public static Result successResult(Object data) {
        return new Result(true, 0000, "success", data);
    }

    public static Result successResult() {
        return successResult(null);
    }

    public static Result failedResult(int code, String message) {

        return new Result(false, code, message, null);
    }
}
